home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWString / SLTxtRun.idl < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.9 KB  |  231 lines  |  [TEXT/MPS ]

  1. //==============================================================================
  2. //
  3. //    File:        SLTxtRun.idl
  4. //
  5. //    Contains:    Interface for OTextRunReader and OTextRunWriter classes
  6. //
  7. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  8. //
  9. //==============================================================================
  10.  
  11. #ifndef SLTXTRUN_IDL
  12. #define SLTXTRUN_IDL
  13.  
  14. #ifndef SLTXTTYP_IDL
  15. #include "SLTxtTyp.idl"
  16. #endif
  17.  
  18. #include <somobj.idl>
  19. #include <somcls.idl>
  20.  
  21. //========================================================================================
  22. // Interfaces defined in this unit
  23. //========================================================================================
  24.  
  25. interface   FW_OTextRunReader;
  26. interface   FW_OTextRunWriter;
  27. interface   FW_OMemoryRunReader;
  28. interface   FW_OMemoryRunWriter;
  29.  
  30. //========================================================================================
  31. // FW_OTextRunReader
  32. //========================================================================================
  33.  
  34. interface FW_OTextRunReader : SOMObject
  35. {
  36.     string GetCurrentRun(out FW_ByteCount length, out FW_Locale locale);
  37.         // Return the address, length, and locale of current text run
  38.  
  39.     boolean NextRun();
  40.         // Advance to the next run
  41.         // Return false if there are no more runs, i.e. current buffer is last run
  42.         // Call GetCurrentRun after calling NextRun to get start and length of new run.
  43.  
  44.     boolean PreviousRun();
  45.         // Backup to the previous run
  46.         // Return false if there are no more runs, i.e. current buffer is first run
  47.         // Call GetCurrentRun after calling PreviousRun to get start and length of new run.
  48.     
  49.     FW_ByteCount GetTotalLength();
  50.         // Return the total number of bytes available for reading.
  51.  
  52. #ifdef __SOMIDL__
  53.     implementation
  54.     {
  55.         functionprefix = "FW_OTextRunReader__";
  56.  
  57.         releaseorder:
  58.             GetCurrentRun,
  59.             NextRun,
  60.             PreviousRun,
  61.             GetTotalLength;
  62.  
  63.  
  64.         majorversion = 1;
  65.         minorversion = 0;
  66.  
  67.         passthru C_xh =
  68.             "";
  69.  
  70.         passthru C_xih =
  71.             "";
  72.  
  73. #ifdef __PRIVATE__    
  74.         // private data members here
  75. #endif
  76.  
  77.     };
  78. #endif
  79. };
  80.  
  81. //========================================================================================
  82. // FW_OTextRunWriter
  83. //========================================================================================
  84.  
  85. interface FW_OTextRunWriter : SOMObject
  86. {
  87.  
  88.     string GetCurrentRun(out FW_ByteCount length);
  89.         // Get start and length of current buffer.
  90.  
  91.     void FlushRun(in string buffer, in FW_ByteCount bytesToFlush);
  92.         // Flush bytes from the current buffer, possibly a subrange of current buffer
  93.  
  94.     boolean NewRun(in FW_Locale locale);
  95.         // Start a new run, where characters will be from specifed locale.
  96.         // Return false if the data structure cannot accept any more text,
  97.         // or if it cannot accept characters from the specified locale.
  98.         // GetCurrentRun must be called to get the buffer for the new run.
  99.  
  100.     void GetLocale(out FW_Locale locale);
  101.         // Return the current locale, if any.
  102.  
  103. #ifdef __SOMIDL__
  104.     implementation
  105.     {
  106.         functionprefix = "FW_OTextRunWriter__";
  107.  
  108.         releaseorder:
  109.             GetCurrentRun,
  110.             FlushRun,
  111.             NewRun,
  112.             GetLocale;
  113.  
  114.         majorversion = 1;
  115.         minorversion = 1;
  116.  
  117.         passthru C_xh =
  118.             "";
  119.  
  120.         passthru C_xih =
  121.             "";
  122.  
  123. #ifdef __PRIVATE__    
  124.         // private data members here
  125. #endif
  126.  
  127.     };
  128. #endif
  129. };
  130.  
  131. //========================================================================================
  132. // FW_OMemoryRunReader
  133. //========================================================================================
  134.  
  135. interface FW_OMemoryRunReader : FW_OTextRunReader
  136. {
  137.     FW_OMemoryRunReader Initialize(in string buffer, in FW_ByteCount length);
  138.     FW_OMemoryRunReader InitWithLocale(in string buffer, in FW_ByteCount length, in FW_Locale locale);
  139.  
  140. #ifdef __SOMIDL__
  141.     implementation
  142.     {
  143.         functionprefix = "FW_OMemoryRunReader__";
  144.  
  145.         override:
  146.             somInit,
  147.             somUninit,
  148.             GetCurrentRun,
  149.             NextRun,
  150.             PreviousRun,
  151.             GetTotalLength;
  152.  
  153.         releaseorder:
  154.             somInit,
  155.             somUninit,
  156.             GetCurrentRun,
  157.             NextRun,
  158.             PreviousRun,
  159.             GetTotalLength,
  160.             Initialize,
  161.             InitWithLocale;
  162.  
  163.  
  164.         majorversion = 1;
  165.         minorversion = 0;
  166.  
  167.         passthru C_xh =
  168.             "";
  169.  
  170.         passthru C_xih =
  171.             "";
  172.  
  173. #ifdef __PRIVATE__    
  174.         // private data members here
  175.         char*            fBuffer;
  176.         FW_ByteCount     fLength;
  177.         FW_Locale        fLocale;
  178. #endif
  179.  
  180.     };
  181. #endif
  182. };
  183.  
  184. //========================================================================================
  185. // FW_OMemoryRunWriter
  186. //========================================================================================
  187.  
  188. interface FW_OMemoryRunWriter : FW_OTextRunWriter
  189. {
  190.     FW_OMemoryRunWriter Initialize(in string buffer, in FW_ByteCount capacity);
  191.  
  192. #ifdef __SOMIDL__
  193.     implementation
  194.     {
  195.         functionprefix = "FW_OMemoryRunWriter__";
  196.  
  197.         override:
  198.             somInit,
  199.             somUninit,
  200.             GetCurrentRun,
  201.             FlushRun,
  202.             NewRun;
  203.  
  204.         releaseorder:
  205.             somInit,
  206.             somUninit,
  207.             GetCurrentRun,
  208.             FlushRun,
  209.             NewRun,
  210.             Initialize;
  211.  
  212.         majorversion = 1;
  213.         minorversion = 0;
  214.  
  215.         passthru C_xh =
  216.             "";
  217.  
  218.         passthru C_xih =
  219.             "";
  220.  
  221. #ifdef __PRIVATE__    
  222.         char*            fBuffer;
  223.         FW_ByteCount     fCapacity;
  224. #endif
  225.  
  226.     };
  227. #endif
  228. };
  229.  
  230. #endif
  231.